<?php


/**
 * Base class that represents a query for the 'wedstrijd' table.
 *
 * 
 *
 * @method     WedstrijdQuery orderByWedstrijdid($order = Criteria::ASC) Order by the wedstrijdID column
 * @method     WedstrijdQuery orderByThuisteam($order = Criteria::ASC) Order by the thuisteam column
 * @method     WedstrijdQuery orderByUitteam($order = Criteria::ASC) Order by the uitteam column
 * @method     WedstrijdQuery orderByPuntenthuis($order = Criteria::ASC) Order by the puntenthuis column
 * @method     WedstrijdQuery orderByPuntenuit($order = Criteria::ASC) Order by the puntenuit column
 * @method     WedstrijdQuery orderByGeelthuis($order = Criteria::ASC) Order by the geelthuis column
 * @method     WedstrijdQuery orderByGeeluit($order = Criteria::ASC) Order by the geeluit column
 * @method     WedstrijdQuery orderByRoodthuis($order = Criteria::ASC) Order by the roodthuis column
 * @method     WedstrijdQuery orderByRooduit($order = Criteria::ASC) Order by the rooduit column
 * @method     WedstrijdQuery orderByDatum($order = Criteria::ASC) Order by the datum column
 * @method     WedstrijdQuery orderByType($order = Criteria::ASC) Order by the type column
 *
 * @method     WedstrijdQuery groupByWedstrijdid() Group by the wedstrijdID column
 * @method     WedstrijdQuery groupByThuisteam() Group by the thuisteam column
 * @method     WedstrijdQuery groupByUitteam() Group by the uitteam column
 * @method     WedstrijdQuery groupByPuntenthuis() Group by the puntenthuis column
 * @method     WedstrijdQuery groupByPuntenuit() Group by the puntenuit column
 * @method     WedstrijdQuery groupByGeelthuis() Group by the geelthuis column
 * @method     WedstrijdQuery groupByGeeluit() Group by the geeluit column
 * @method     WedstrijdQuery groupByRoodthuis() Group by the roodthuis column
 * @method     WedstrijdQuery groupByRooduit() Group by the rooduit column
 * @method     WedstrijdQuery groupByDatum() Group by the datum column
 * @method     WedstrijdQuery groupByType() Group by the type column
 *
 * @method     WedstrijdQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method     WedstrijdQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method     WedstrijdQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method     WedstrijdQuery leftJoinTeamRelatedByThuisteam($relationAlias = null) Adds a LEFT JOIN clause to the query using the TeamRelatedByThuisteam relation
 * @method     WedstrijdQuery rightJoinTeamRelatedByThuisteam($relationAlias = null) Adds a RIGHT JOIN clause to the query using the TeamRelatedByThuisteam relation
 * @method     WedstrijdQuery innerJoinTeamRelatedByThuisteam($relationAlias = null) Adds a INNER JOIN clause to the query using the TeamRelatedByThuisteam relation
 *
 * @method     WedstrijdQuery leftJoinTeamRelatedByUitteam($relationAlias = null) Adds a LEFT JOIN clause to the query using the TeamRelatedByUitteam relation
 * @method     WedstrijdQuery rightJoinTeamRelatedByUitteam($relationAlias = null) Adds a RIGHT JOIN clause to the query using the TeamRelatedByUitteam relation
 * @method     WedstrijdQuery innerJoinTeamRelatedByUitteam($relationAlias = null) Adds a INNER JOIN clause to the query using the TeamRelatedByUitteam relation
 *
 * @method     WedstrijdQuery leftJoinVoorspelling($relationAlias = null) Adds a LEFT JOIN clause to the query using the Voorspelling relation
 * @method     WedstrijdQuery rightJoinVoorspelling($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Voorspelling relation
 * @method     WedstrijdQuery innerJoinVoorspelling($relationAlias = null) Adds a INNER JOIN clause to the query using the Voorspelling relation
 *
 * @method     Wedstrijd findOne(PropelPDO $con = null) Return the first Wedstrijd matching the query
 * @method     Wedstrijd findOneOrCreate(PropelPDO $con = null) Return the first Wedstrijd matching the query, or a new Wedstrijd object populated from the query conditions when no match is found
 *
 * @method     Wedstrijd findOneByWedstrijdid(int $wedstrijdID) Return the first Wedstrijd filtered by the wedstrijdID column
 * @method     Wedstrijd findOneByThuisteam(int $thuisteam) Return the first Wedstrijd filtered by the thuisteam column
 * @method     Wedstrijd findOneByUitteam(int $uitteam) Return the first Wedstrijd filtered by the uitteam column
 * @method     Wedstrijd findOneByPuntenthuis(int $puntenthuis) Return the first Wedstrijd filtered by the puntenthuis column
 * @method     Wedstrijd findOneByPuntenuit(int $puntenuit) Return the first Wedstrijd filtered by the puntenuit column
 * @method     Wedstrijd findOneByGeelthuis(int $geelthuis) Return the first Wedstrijd filtered by the geelthuis column
 * @method     Wedstrijd findOneByGeeluit(int $geeluit) Return the first Wedstrijd filtered by the geeluit column
 * @method     Wedstrijd findOneByRoodthuis(int $roodthuis) Return the first Wedstrijd filtered by the roodthuis column
 * @method     Wedstrijd findOneByRooduit(int $rooduit) Return the first Wedstrijd filtered by the rooduit column
 * @method     Wedstrijd findOneByDatum(string $datum) Return the first Wedstrijd filtered by the datum column
 * @method     Wedstrijd findOneByType(int $type) Return the first Wedstrijd filtered by the type column
 *
 * @method     array findByWedstrijdid(int $wedstrijdID) Return Wedstrijd objects filtered by the wedstrijdID column
 * @method     array findByThuisteam(int $thuisteam) Return Wedstrijd objects filtered by the thuisteam column
 * @method     array findByUitteam(int $uitteam) Return Wedstrijd objects filtered by the uitteam column
 * @method     array findByPuntenthuis(int $puntenthuis) Return Wedstrijd objects filtered by the puntenthuis column
 * @method     array findByPuntenuit(int $puntenuit) Return Wedstrijd objects filtered by the puntenuit column
 * @method     array findByGeelthuis(int $geelthuis) Return Wedstrijd objects filtered by the geelthuis column
 * @method     array findByGeeluit(int $geeluit) Return Wedstrijd objects filtered by the geeluit column
 * @method     array findByRoodthuis(int $roodthuis) Return Wedstrijd objects filtered by the roodthuis column
 * @method     array findByRooduit(int $rooduit) Return Wedstrijd objects filtered by the rooduit column
 * @method     array findByDatum(string $datum) Return Wedstrijd objects filtered by the datum column
 * @method     array findByType(int $type) Return Wedstrijd objects filtered by the type column
 *
 * @package    propel.generator.database.om
 */
abstract class BaseWedstrijdQuery extends ModelCriteria
{

	/**
	 * Initializes internal state of BaseWedstrijdQuery object.
	 *
	 * @param     string $dbName The dabase name
	 * @param     string $modelName The phpName of a model, e.g. 'Book'
	 * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
	 */
	public function __construct($dbName = 'database', $modelName = 'Wedstrijd', $modelAlias = null)
	{
		parent::__construct($dbName, $modelName, $modelAlias);
	}

	/**
	 * Returns a new WedstrijdQuery object.
	 *
	 * @param     string $modelAlias The alias of a model in the query
	 * @param     Criteria $criteria Optional Criteria to build the query from
	 *
	 * @return    WedstrijdQuery
	 */
	public static function create($modelAlias = null, $criteria = null)
	{
		if ($criteria instanceof WedstrijdQuery) {
			return $criteria;
		}
		$query = new WedstrijdQuery();
		if (null !== $modelAlias) {
			$query->setModelAlias($modelAlias);
		}
		if ($criteria instanceof Criteria) {
			$query->mergeWith($criteria);
		}
		return $query;
	}

	/**
	 * Find object by primary key
	 * Use instance pooling to avoid a database query if the object exists
	 * <code>
	 * $obj  = $c->findPk(12, $con);
	 * </code>
	 * @param     mixed $key Primary key to use for the query
	 * @param     PropelPDO $con an optional connection object
	 *
	 * @return    Wedstrijd|array|mixed the result, formatted by the current formatter
	 */
	public function findPk($key, $con = null)
	{
		if ((null !== ($obj = WedstrijdPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
			// the object is alredy in the instance pool
			return $obj;
		} else {
			// the object has not been requested yet, or the formatter is not an object formatter
			$criteria = $this->isKeepQuery() ? clone $this : $this;
			$stmt = $criteria
				->filterByPrimaryKey($key)
				->getSelectStatement($con);
			return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
		}
	}

	/**
	 * Find objects by primary key
	 * <code>
	 * $objs = $c->findPks(array(12, 56, 832), $con);
	 * </code>
	 * @param     array $keys Primary keys to use for the query
	 * @param     PropelPDO $con an optional connection object
	 *
	 * @return    PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
	 */
	public function findPks($keys, $con = null)
	{	
		$criteria = $this->isKeepQuery() ? clone $this : $this;
		return $this
			->filterByPrimaryKeys($keys)
			->find($con);
	}

	/**
	 * Filter the query by primary key
	 *
	 * @param     mixed $key Primary key to use for the query
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByPrimaryKey($key)
	{
		return $this->addUsingAlias(WedstrijdPeer::WEDSTRIJDID, $key, Criteria::EQUAL);
	}

	/**
	 * Filter the query by a list of primary keys
	 *
	 * @param     array $keys The list of primary key to use for the query
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByPrimaryKeys($keys)
	{
		return $this->addUsingAlias(WedstrijdPeer::WEDSTRIJDID, $keys, Criteria::IN);
	}

	/**
	 * Filter the query on the wedstrijdID column
	 * 
	 * @param     int|array $wedstrijdid The value to use as filter.
	 *            Accepts an associative array('min' => $minValue, 'max' => $maxValue)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByWedstrijdid($wedstrijdid = null, $comparison = null)
	{
		if (is_array($wedstrijdid) && null === $comparison) {
			$comparison = Criteria::IN;
		}
		return $this->addUsingAlias(WedstrijdPeer::WEDSTRIJDID, $wedstrijdid, $comparison);
	}

	/**
	 * Filter the query on the thuisteam column
	 * 
	 * @param     int|array $thuisteam The value to use as filter.
	 *            Accepts an associative array('min' => $minValue, 'max' => $maxValue)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByThuisteam($thuisteam = null, $comparison = null)
	{
		if (is_array($thuisteam)) {
			$useMinMax = false;
			if (isset($thuisteam['min'])) {
				$this->addUsingAlias(WedstrijdPeer::THUISTEAM, $thuisteam['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($thuisteam['max'])) {
				$this->addUsingAlias(WedstrijdPeer::THUISTEAM, $thuisteam['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(WedstrijdPeer::THUISTEAM, $thuisteam, $comparison);
	}

	/**
	 * Filter the query on the uitteam column
	 * 
	 * @param     int|array $uitteam The value to use as filter.
	 *            Accepts an associative array('min' => $minValue, 'max' => $maxValue)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByUitteam($uitteam = null, $comparison = null)
	{
		if (is_array($uitteam)) {
			$useMinMax = false;
			if (isset($uitteam['min'])) {
				$this->addUsingAlias(WedstrijdPeer::UITTEAM, $uitteam['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($uitteam['max'])) {
				$this->addUsingAlias(WedstrijdPeer::UITTEAM, $uitteam['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(WedstrijdPeer::UITTEAM, $uitteam, $comparison);
	}

	/**
	 * Filter the query on the puntenthuis column
	 * 
	 * @param     int|array $puntenthuis The value to use as filter.
	 *            Accepts an associative array('min' => $minValue, 'max' => $maxValue)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByPuntenthuis($puntenthuis = null, $comparison = null)
	{
		if (is_array($puntenthuis)) {
			$useMinMax = false;
			if (isset($puntenthuis['min'])) {
				$this->addUsingAlias(WedstrijdPeer::PUNTENTHUIS, $puntenthuis['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($puntenthuis['max'])) {
				$this->addUsingAlias(WedstrijdPeer::PUNTENTHUIS, $puntenthuis['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(WedstrijdPeer::PUNTENTHUIS, $puntenthuis, $comparison);
	}

	/**
	 * Filter the query on the puntenuit column
	 * 
	 * @param     int|array $puntenuit The value to use as filter.
	 *            Accepts an associative array('min' => $minValue, 'max' => $maxValue)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByPuntenuit($puntenuit = null, $comparison = null)
	{
		if (is_array($puntenuit)) {
			$useMinMax = false;
			if (isset($puntenuit['min'])) {
				$this->addUsingAlias(WedstrijdPeer::PUNTENUIT, $puntenuit['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($puntenuit['max'])) {
				$this->addUsingAlias(WedstrijdPeer::PUNTENUIT, $puntenuit['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(WedstrijdPeer::PUNTENUIT, $puntenuit, $comparison);
	}

	/**
	 * Filter the query on the geelthuis column
	 * 
	 * @param     int|array $geelthuis The value to use as filter.
	 *            Accepts an associative array('min' => $minValue, 'max' => $maxValue)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByGeelthuis($geelthuis = null, $comparison = null)
	{
		if (is_array($geelthuis)) {
			$useMinMax = false;
			if (isset($geelthuis['min'])) {
				$this->addUsingAlias(WedstrijdPeer::GEELTHUIS, $geelthuis['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($geelthuis['max'])) {
				$this->addUsingAlias(WedstrijdPeer::GEELTHUIS, $geelthuis['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(WedstrijdPeer::GEELTHUIS, $geelthuis, $comparison);
	}

	/**
	 * Filter the query on the geeluit column
	 * 
	 * @param     int|array $geeluit The value to use as filter.
	 *            Accepts an associative array('min' => $minValue, 'max' => $maxValue)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByGeeluit($geeluit = null, $comparison = null)
	{
		if (is_array($geeluit)) {
			$useMinMax = false;
			if (isset($geeluit['min'])) {
				$this->addUsingAlias(WedstrijdPeer::GEELUIT, $geeluit['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($geeluit['max'])) {
				$this->addUsingAlias(WedstrijdPeer::GEELUIT, $geeluit['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(WedstrijdPeer::GEELUIT, $geeluit, $comparison);
	}

	/**
	 * Filter the query on the roodthuis column
	 * 
	 * @param     int|array $roodthuis The value to use as filter.
	 *            Accepts an associative array('min' => $minValue, 'max' => $maxValue)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByRoodthuis($roodthuis = null, $comparison = null)
	{
		if (is_array($roodthuis)) {
			$useMinMax = false;
			if (isset($roodthuis['min'])) {
				$this->addUsingAlias(WedstrijdPeer::ROODTHUIS, $roodthuis['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($roodthuis['max'])) {
				$this->addUsingAlias(WedstrijdPeer::ROODTHUIS, $roodthuis['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(WedstrijdPeer::ROODTHUIS, $roodthuis, $comparison);
	}

	/**
	 * Filter the query on the rooduit column
	 * 
	 * @param     int|array $rooduit The value to use as filter.
	 *            Accepts an associative array('min' => $minValue, 'max' => $maxValue)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByRooduit($rooduit = null, $comparison = null)
	{
		if (is_array($rooduit)) {
			$useMinMax = false;
			if (isset($rooduit['min'])) {
				$this->addUsingAlias(WedstrijdPeer::ROODUIT, $rooduit['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($rooduit['max'])) {
				$this->addUsingAlias(WedstrijdPeer::ROODUIT, $rooduit['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(WedstrijdPeer::ROODUIT, $rooduit, $comparison);
	}

	/**
	 * Filter the query on the datum column
	 * 
	 * @param     string|array $datum The value to use as filter.
	 *            Accepts an associative array('min' => $minValue, 'max' => $maxValue)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByDatum($datum = null, $comparison = null)
	{
		if (is_array($datum)) {
			$useMinMax = false;
			if (isset($datum['min'])) {
				$this->addUsingAlias(WedstrijdPeer::DATUM, $datum['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($datum['max'])) {
				$this->addUsingAlias(WedstrijdPeer::DATUM, $datum['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(WedstrijdPeer::DATUM, $datum, $comparison);
	}

	/**
	 * Filter the query on the type column
	 * 
	 * @param     int|array $type The value to use as filter.
	 *            Accepts an associative array('min' => $minValue, 'max' => $maxValue)
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByType($type = null, $comparison = null)
	{
		if (is_array($type)) {
			$useMinMax = false;
			if (isset($type['min'])) {
				$this->addUsingAlias(WedstrijdPeer::TYPE, $type['min'], Criteria::GREATER_EQUAL);
				$useMinMax = true;
			}
			if (isset($type['max'])) {
				$this->addUsingAlias(WedstrijdPeer::TYPE, $type['max'], Criteria::LESS_EQUAL);
				$useMinMax = true;
			}
			if ($useMinMax) {
				return $this;
			}
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(WedstrijdPeer::TYPE, $type, $comparison);
	}

	/**
	 * Filter the query by a related Team object
	 *
	 * @param     Team $team  the related object to use as filter
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByTeamRelatedByThuisteam($team, $comparison = null)
	{
		return $this
			->addUsingAlias(WedstrijdPeer::THUISTEAM, $team->getTeamid(), $comparison);
	}

	/**
	 * Adds a JOIN clause to the query using the TeamRelatedByThuisteam relation
	 * 
	 * @param     string $relationAlias optional alias for the relation
	 * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function joinTeamRelatedByThuisteam($relationAlias = null, $joinType = Criteria::INNER_JOIN)
	{
		$tableMap = $this->getTableMap();
		$relationMap = $tableMap->getRelation('TeamRelatedByThuisteam');
		
		// create a ModelJoin object for this join
		$join = new ModelJoin();
		$join->setJoinType($joinType);
		$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
		if ($previousJoin = $this->getPreviousJoin()) {
			$join->setPreviousJoin($previousJoin);
		}
		
		// add the ModelJoin to the current object
		if($relationAlias) {
			$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
			$this->addJoinObject($join, $relationAlias);
		} else {
			$this->addJoinObject($join, 'TeamRelatedByThuisteam');
		}
		
		return $this;
	}

	/**
	 * Use the TeamRelatedByThuisteam relation Team object
	 *
	 * @see       useQuery()
	 * 
	 * @param     string $relationAlias optional alias for the relation,
	 *                                   to be used as main alias in the secondary query
	 * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
	 *
	 * @return    TeamQuery A secondary query class using the current class as primary query
	 */
	public function useTeamRelatedByThuisteamQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
	{
		return $this
			->joinTeamRelatedByThuisteam($relationAlias, $joinType)
			->useQuery($relationAlias ? $relationAlias : 'TeamRelatedByThuisteam', 'TeamQuery');
	}

	/**
	 * Filter the query by a related Team object
	 *
	 * @param     Team $team  the related object to use as filter
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByTeamRelatedByUitteam($team, $comparison = null)
	{
		return $this
			->addUsingAlias(WedstrijdPeer::UITTEAM, $team->getTeamid(), $comparison);
	}

	/**
	 * Adds a JOIN clause to the query using the TeamRelatedByUitteam relation
	 * 
	 * @param     string $relationAlias optional alias for the relation
	 * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function joinTeamRelatedByUitteam($relationAlias = null, $joinType = Criteria::INNER_JOIN)
	{
		$tableMap = $this->getTableMap();
		$relationMap = $tableMap->getRelation('TeamRelatedByUitteam');
		
		// create a ModelJoin object for this join
		$join = new ModelJoin();
		$join->setJoinType($joinType);
		$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
		if ($previousJoin = $this->getPreviousJoin()) {
			$join->setPreviousJoin($previousJoin);
		}
		
		// add the ModelJoin to the current object
		if($relationAlias) {
			$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
			$this->addJoinObject($join, $relationAlias);
		} else {
			$this->addJoinObject($join, 'TeamRelatedByUitteam');
		}
		
		return $this;
	}

	/**
	 * Use the TeamRelatedByUitteam relation Team object
	 *
	 * @see       useQuery()
	 * 
	 * @param     string $relationAlias optional alias for the relation,
	 *                                   to be used as main alias in the secondary query
	 * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
	 *
	 * @return    TeamQuery A secondary query class using the current class as primary query
	 */
	public function useTeamRelatedByUitteamQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
	{
		return $this
			->joinTeamRelatedByUitteam($relationAlias, $joinType)
			->useQuery($relationAlias ? $relationAlias : 'TeamRelatedByUitteam', 'TeamQuery');
	}

	/**
	 * Filter the query by a related Voorspelling object
	 *
	 * @param     Voorspelling $voorspelling  the related object to use as filter
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function filterByVoorspelling($voorspelling, $comparison = null)
	{
		return $this
			->addUsingAlias(WedstrijdPeer::WEDSTRIJDID, $voorspelling->getWedstrijdid(), $comparison);
	}

	/**
	 * Adds a JOIN clause to the query using the Voorspelling relation
	 * 
	 * @param     string $relationAlias optional alias for the relation
	 * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function joinVoorspelling($relationAlias = null, $joinType = Criteria::INNER_JOIN)
	{
		$tableMap = $this->getTableMap();
		$relationMap = $tableMap->getRelation('Voorspelling');
		
		// create a ModelJoin object for this join
		$join = new ModelJoin();
		$join->setJoinType($joinType);
		$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
		if ($previousJoin = $this->getPreviousJoin()) {
			$join->setPreviousJoin($previousJoin);
		}
		
		// add the ModelJoin to the current object
		if($relationAlias) {
			$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
			$this->addJoinObject($join, $relationAlias);
		} else {
			$this->addJoinObject($join, 'Voorspelling');
		}
		
		return $this;
	}

	/**
	 * Use the Voorspelling relation Voorspelling object
	 *
	 * @see       useQuery()
	 * 
	 * @param     string $relationAlias optional alias for the relation,
	 *                                   to be used as main alias in the secondary query
	 * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
	 *
	 * @return    VoorspellingQuery A secondary query class using the current class as primary query
	 */
	public function useVoorspellingQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
	{
		return $this
			->joinVoorspelling($relationAlias, $joinType)
			->useQuery($relationAlias ? $relationAlias : 'Voorspelling', 'VoorspellingQuery');
	}

	/**
	 * Exclude object from result
	 *
	 * @param     Wedstrijd $wedstrijd Object to remove from the list of results
	 *
	 * @return    WedstrijdQuery The current query, for fluid interface
	 */
	public function prune($wedstrijd = null)
	{
		if ($wedstrijd) {
			$this->addUsingAlias(WedstrijdPeer::WEDSTRIJDID, $wedstrijd->getWedstrijdid(), Criteria::NOT_EQUAL);
	  }
	  
		return $this;
	}

} // BaseWedstrijdQuery
